﻿using DFGK_WMS.Model.Dto;
using DFGK_WMS.Model.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DFGK.IService
{
    public interface IUserService
    {
        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        bool AddUser(User m,out string message);

        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="uid"></param>
        /// <returns></returns>
        bool DelUser(long uid);

        /// <summary>
        /// 修改用户
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        bool UpdUser(User m, out string message);

        /// <summary>
        /// 根据主键获取用户信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        User? GetUserById(long id);

        /// <summary>
        /// 判断登录
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        User GetLogin(LoginDto m, out string message);

        /// <summary>
        /// 根据用户Id获取对应权限
        /// </summary>
        /// <param name="uid"></param>
        /// <returns></returns>
        List<UserRoleMenuAction> GetMenuitemAction(long uid);

        /// <summary>
        /// 升级版根据用户id获取菜单权限
        /// </summary>
        /// <param name="uid"></param>
        /// <returns></returns>
        List<UserRoleMenus> GetMenuitem(long uid);

        /// <summary>
        /// 用户显示
        /// </summary>
        /// <param name="uname"></param>
        /// <param name="rid"></param>
        /// <param name="state"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<User> GetUserList(string uname, long rid, int state, int pageIndex, int pageSize, out int totalCount);
    }
}
